using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Domain;
using Domain.Model;

namespace ShortUrl.Models
{
    public class UrlModel
    {
        public IList<Url> Urls { get; set; }
        private string _longurl;
        private string _shorturl;
            public string LongUrl
            {
                get { return _longurl; }
                set
                {
                    _longurl = value;
                    ShortUrl = LongUrl;
                    Date = DateTime.Today;
                }
            }

            public string ShortUrl 
            {
                get { return _shorturl; }
                private set { _shorturl = TransfomUrl.Transfom(value); }
            }

            public  DateTime Date{ get; private set;}
            public string Anonymous { get; set; } 

        }
}